import os
import shutil


class IMG(object):
    '''
    1，读取差异txt，获取差异图片
    2，复制图片到当前目录
    '''

    def get_img(self):
        with open("img.txt", "r", encoding='utf-8') as f:
            if not os.path.exists("img"):
                os.mkdir("img")
            for line in f.read().splitlines():
                shutil.copyfile(rf"D:\TPDotnet\Pictures\Customer\{line}", rf".\img\{line}")
        f.close()


if __name__ == '__main__':
    img = IMG()
    img.get_img()